/**
 * @author zhengjiachao
 * @since 2017-3-27
 */
ADF.control.Label = function(){
    ADF.control.Label.superclass.constructor.call(this);
};

COM.util.defineClass(ADF.control.Label, ADF.ControlDescriptor,{

    getEditpart : function(){
        var editpart = function(){
            editpart.superclass.constructor.call(this);
        };
        COM.util.defineClass(editpart, ADF.editpart.BaseEditpart, {
            _createFigure:function(){
                var labelFigure=new AGEF.WidgetFigure(this.id);
                var label=this.getWidgetFactory().createControl(this.getModel());
                labelFigure.setWidget(label);
                return labelFigure;
            },
            // createEditPolicies:function(){
            //     this.installEditPolicy(COM.gef.EditPolicy.COMPONENT_ROLE,new ADF.policy.LabelComponentEditPartPolicy());
            // },
            propertyChange:function(evt){
                editpart.superclass.propertyChange.call(this, evt);
                if(AGEF.PropertyChangeEvent.UPDATE_EVENT==evt.getType()){
                    if(ADF.model.LabelModel.PROPERTY_TEXT==evt.getPropertyName()){
                        this.getFigure().getWidget().setText(evt.newValue);
                    }
                }
            }
        });
        return editpart;
    },

    getModel : function(){
        return ADF.model.LabelModel;
    },

    getDomControl:function(){
        return ADF.domControl.Label;
    }

});